if(window.location.href.split('&')[1]){
    $('.account-tab a').removeClass('tab-active');
    $('.tab-wallet').addClass('tab-active');
    $('.tab-wallet').css('display','block');
    $('.main-card').css('display','none');
     $('.wallet-not').css('display','block');
}else{}
//银行卡虚拟钱包tab切换
$('.account-tab a').click(function(){
    $('.account-tab a').removeClass('tab-active');
    $(this).addClass('tab-active');
})
$('.tab-bankcard').click(function(){
    $('.main-card').css('display','block');
    $('.wallet-not').css('display','none');
})
$('.tab-wallet').click(function(){
    $('.main-card').css('display','none');
    $('.wallet-not').css('display','block');
})
//银行卡
//银行卡充值方式切换
$('.transfer').click(function(){
    $('.transfer').removeClass('transfer-active');
    $('.transfer').find('img').css('display','none');
    $(this).addClass('transfer-active');
    $(this).find('img').css('display','block');
});
$('.alipay').click(function(){
    $('.row-recharge').css('display','block');
    $('.transfer-money').css('display','none');
    $('.alipay-ewm').css('display','block');
    $('.wx-ewm').css('display','none');
})
$('.wx').click(function(){
    $('.row-recharge').css('display','block');
    $('.transfer-money').css('display','none');
    $('.alipay-ewm').css('display','none');
    $('.wx-ewm').css('display','block');
})
$('.banks').click(function(){
    $('.row-recharge').css('display','none');
    $('.transfer-money').css('display','block');
})
//银行卡充值
$('.recharge-btn').click(function(){
    var amount = $('.amount').val();
    if(!amount){
        $('.info-err').html('充值金额不能为空');
    }
    var payType = $('.transfer-active').attr('id');
    var data = {
       amount:amount,
       payType:Number(payType),
       walletType:1
     }
    if(amount){
       $.ajax({
      url:"/capital-recharge.json",
      type:"post",
         data:JSON.stringify(data),
         contentType:'application/json;charset=UTF-8',
      success:function(data){
           console.log(data)
           $('.info-err').html('请求发送成功，请等待审核');
       },
       error: function(msg) {
           console.log(msg)
       }
   })
  }
})
//虚拟钱包
$('.rechange-wallet-btn').click(function(){
    var virtualAmount = $('.virtual-amount-not') .val();
     if(!virtualAmount){
          $('.info-err2').html('虚拟币充值金额不能为空');
      }
      var data = {
            payType:4,
           walletType:2,
           amount:100*virtualAmount
      };
      if(virtualAmount){
        $.ajax({
              url:"/capital-recharge.json",
              type:"post",
                 data:JSON.stringify(data),
                 contentType:'application/json;charset=UTF-8',
              success:function(data){
                   console.log(data)
                   $('.info-err2').html('请求发送成功，请等待审核');
               },
               error: function(msg) {
                   console.log(msg)
               }
           })
      }
})
